Methods and device for signaling image information

ABSTRACT

An image decoding method performed by a decoding device according to the present disclosure comprises the steps of: obtaining prediction-related information and indication information comprising a first flag which indicates whether or not a sample adaptive offset (SAO) process to be applied to a current block is applied at a picture level or a slice level; parsing information related to the SAO process from a picture header or a slice header on the basis of the first flag; generating prediction samples for the current block on the basis of the prediction-related information; generating reconstructed samples for the current block on the basis of the prediction samples; and performing the SAO process for the reconstructed samples on the basis of the information related to the SAO process.

BACKGROUND OF THE DISCLOSURE Field of the Disclosure

The present disclosure relates to a method and device for signalingimage information in an image coding system.

Related Art

Recently, the demand for high-resolution and high-quality images, suchas High Definition (HD) images and Ultra High Definition (UHD) imageshas been increasing in various fields. As the resolution and quality ofthe image data become higher, the information size or bit size that isbeing transmitted increases as compared to the existing image data.Therefore, when transmitting image data by using a same medium, such asa conventional (or existing) wired/wireless broadband line, or whenusing a conventional (or existing) storage medium to store image data,transmission cost and storage cost may be increased.

Accordingly, a high efficiency image compression technique foreffectively transmitting or storing and reproducing (or playing-back)information on high-resolution and high-quality image is required.

SUMMARY OF THE DISCLOSURE Technical Objects

A technical object of the present disclosure is to provide a method andapparatus for increased image coding efficiency.

Another technical object of the present disclosure is to provide amethod and device for signaling image information that is applied at apicture level or a slice level.

Technical Solutions

According to an embodiment of the present disclosure, provided herein isan image decoding method performed by a decoding apparatus. The methodmay include the steps of obtaining indication information including afirst flag indicating whether a Sample Adaptive Offset (SAO) procedurefor a current block is applied at a picture level or a slice level andprediction related information, parsing information related to the SAOprocedure from a picture header or a slice header based on the firstflag, generating prediction samples for the current block based on theprediction related information,

generating reconstructed samples for the current block based on theprediction samples, and performing the SAO procedure on thereconstructed samples based on the information related to the SAOprocedure.

According to another embodiment of the present disclosure, providedherein is an image encoding method performed by an encoding apparatus.The method may include the steps of determining a prediction mode of acurrent block and deriving prediction samples based on the predictionmode, generating reconstructed samples based on the prediction samples,performing a Sample Adaptive Offset (SAO) procedure on the reconstructedsamples, generating indication information including a first flagindicating whether the SAO procedure is applied at a picture level or aslice level, and encoding the indication information and imageinformation including the information related to the SAO procedure. And,herein, the first flag indicates whether the information related to theSAO procedure is present in the picture header or in the slice header.

According to yet another embodiment of the present disclosure, providedherein is a computer readable digital recording medium having encodedimage information stored therein that allows an image decoding method tobe performed by a decoding apparatus. The image decoding methodaccording to the embodiment may include the steps of obtainingindication information including a first flag indicating whether aSample Adaptive Offset (SAO) procedure for a current block is applied ata picture level or a slice level and prediction related information,parsing information related to the SAO procedure from a picture headeror a slice header based on the first flag, deriving prediction samplesfor the current block based on the prediction related information,generating reconstructed samples based on the prediction samples, andperforming the SAO procedure on the reconstructed samples based on theinformation related to the SAO procedure.

Effects of the Disclosure

According to the present specification, overall image/video compressionefficiency may be increased.

According to the present specification, efficiency in image decoding maybe increased, based on indication information indicating whether or nota tool that is applied for a current block is being applied at a picturelevel or a slice level.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 schematically illustrates an example of a video/image codingsystem to which the present disclosure is applicable.

FIG. 2 is a diagram schematically illustrating a configuration of avideo/image encoding apparatus to which the present disclosure isapplicable.

FIG. 3 is a diagram schematically illustrating a configuration of avideo/image decoding apparatus to which the present disclosure isapplicable.

FIG. 4 illustrates an exemplary hierarchical structure of coded data.

FIG. 5 is a diagram illustrating an example of a candidate block thatmay be used in a case where inter prediction for a current block isperformed.

FIG. 6 is a flowchart illustrating a method for performing deblockingfiltering.

FIG. 7 is a flowchart schematically illustrating an example of an ALFprocedure.

FIG. 8 illustrates an example of a filter shape for ALF.

FIG. 9 is a flowchart illustrating an operation of an image encodingapparatus according to an embodiment.

FIG. 10 is a block diagram illustrating a configuration of an imageencoding apparatus according to an embodiment.

FIG. 11 is a flowchart illustrating an operation of an image decodingapparatus according to an embodiment.

FIG. 12 is a block diagram illustrating a configuration of an imagedecoding apparatus according to an embodiment.

FIG. 13 illustrates an exemplary structure of a content streaming systemto which the present disclosure is applicable.

DESCRIPTION OF EXEMPLARY EMBODIMENTS

The present document may be modified in various forms, and specificembodiments thereof will be described and shown in the drawings.However, the embodiments are not intended for limiting the presentdocument. The terms used in the following description are used to merelydescribe specific embodiments, but are not intended to limit the presentdocument. An expression of a singular number includes an expression ofthe plural number, so long as it is clearly read differently. The termssuch as “include” and “have” are intended to indicate that features,numbers, steps, operations, elements, components, or combinationsthereof used in the following description exist and it should be thusunderstood that the possibility of existence or addition of one or moredifferent features, numbers, steps, operations, elements, components, orcombinations thereof is not excluded.

Meanwhile, each configuration in the drawings described in the presentdocument is shown independently for the convenience of descriptionregarding different characteristic functions, and does not mean thateach configuration is implemented as separate hardware or separatesoftware. For example, two or more components among each component maybe combined to form one component, or one component may be divided intoa plurality of components. An embodiment in which elements are combinedand/or separated is also included in the scope of rights of thisdocument unless it deviates from the essence of this document.

In the present disclosure, the term “A or B” may mean “only A”, “onlyB”, or “both A and B”. In other words, in the present disclosure, theterm “A or B” may be interpreted to indicate “A and/or B”. For example,in the present disclosure, the term “A, B or C” may mean “only A”, “onlyB”, “only C”, or “any combination of A, B and C”.

A slash “/” or a comma used in the present disclosure may mean “and/or”.For example, “A/B” may mean “A and/or B”. Accordingly, “A/B” may mean“only A”, “only B”, or “both A and B”. For example, “A, B, C” may mean“A, B or C”.

In the present disclosure, “at least one of A and B” may mean “only A”,“only B”, or “both A and B”. Further, in the present disclosure, theexpression “at least one of A or B” or “at least one of A and/or B” maybe interpreted the same as “at least one of A and B”.

Further, in the present disclosure, “at least one of A, B and C” maymean “only A”, “only B”, “only C”, or “any combination of A, B and C”.Further, “at least one of A, B or C” or “at least one of A, B and/or C”may mean “at least one of A, B and C”.

Further, the parentheses used in the present disclosure may mean “forexample”. Specifically, in the case that “prediction (intra prediction)”is expressed, it may be indicated that “intra prediction” is proposed asan example of “prediction”. In other words, the term “prediction” in thepresent disclosure is not limited to “intra prediction”, and it may beindicated that “intra prediction” is proposed as an example of“prediction”. Further, even in the case that “prediction (i.e., intraprediction)” is expressed, it may be indicated that “intra prediction”is proposed as an example of “prediction”.

Technical features that are individually described in a diagram of thepresent specification may be implemented individually, or may beimplemented simultaneously.

Hereinafter, a preferred embodiment of the present disclosure will bedescribed in more detail with reference to the appended drawings.Hereinafter, same reference numerals will be used for indicating thesame configuration elements within the drawings, and overlapping (orrepetitive) description of the same configuration element(s) will beomitted for simplicity.

FIG. 1 schematically illustrates an example of a video/image codingsystem to which the present disclosure is applicable.

Referring to FIG. 1 , a video/image coding system may include a firstdevice (a source device) and a second device (a reception device). Thesource device may transmit encoded video/image information or data tothe reception device through a digital storage medium or network in theform of a file or streaming.

The source device may include a video source, an encoding apparatus, anda transmitter. The receiving device may include a receiver, a decodingapparatus, and a renderer. The encoding apparatus may be called avideo/image encoding apparatus, and the decoding apparatus may be calleda video/image decoding apparatus. The transmitter may be included in theencoding apparatus. The receiver may be included in the decodingapparatus. The renderer may include a display, and the display may beconfigured as a separate device or an external component.

The video source may acquire video/image through a process of capturing,synthesizing, or generating the video/image. The video source mayinclude a video/image capture device and/or a video/image generatingdevice. The video/image capture device may include, for example, one ormore cameras, video/image archives including previously capturedvideo/images, and the like. The video/image generating device mayinclude, for example, computers, tablets and smartphones, and may(electronically) generate video/images. For example, a virtualvideo/image may be generated through a computer or the like. In thiscase, the video/image capturing process may be replaced by a process ofgenerating related data.

The encoding apparatus may encode input video/image. The encodingapparatus may perform a series of procedures such as prediction,transform, and quantization for compaction and coding efficiency. Theencoded data (encoded video/image information) may be output in the formof a bitstream.

The transmitter may transmit the encoded image/image information or dataoutput in the form of a bitstream to the receiver of the receivingdevice through a digital storage medium or a network in the form of afile or streaming. The digital storage medium may include variousstorage mediums such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, and thelike. The transmitter may include an element for generating a media filethrough a predetermined file format and may include an element fortransmission through a broadcast/communication network. The receiver mayreceive/extract the bitstream and transmit the received bitstream to thedecoding apparatus.

The decoding apparatus may decode the video/image by performing a seriesof procedures such as dequantization, inverse transform, and predictioncorresponding to the operation of the encoding apparatus.

The renderer may render the decoded video/image. The renderedvideo/image may be displayed through the display.

The present specification relates to video/image coding. For example,the method/example disclosed in the present specification may be appliedto a method that is disclosed in a Versatile Video Coding (VVC)standard, an essential video coding (EVC) standard, an AOMedia Video 1(AV1) standard, a 2nd generation of audio video coding standard (AVS2),or other next-generation video/image coding standard(s) (e.g., H.267 orH.268, and so on).

The present document suggests various embodiments of video/image coding,and the above embodiments may also be performed in combination with eachother unless otherwise specified.

In the present document, a video may refer to a series of images overtime. A picture generally refers to the unit representing one image at aparticular time frame, and a slice/tile refers to the unit constitutinga part of the picture in terms of coding. A slice/tile may include oneor more coding tree units (CTUs). One picture may consist of one or moreslices/tiles.

A tile is a rectangular region of CTUs within a particular tile columnand a particular tile row in a picture. The tile column is a rectangularregion of CTUs having a height equal to the height of the picture and awidth specified by syntax elements in the picture parameter set. Thetile row is a rectangular region of CTUs having a width specified bysyntax elements in the picture parameter set and a height equal to theheight of the picture. A tile scan is a specific sequential ordering ofCTUs partitioning a picture in which the CTUs are ordered consecutivelyin CTU raster scan in a tile whereas tiles in a picture are orderedconsecutively in a raster scan of the tiles of the picture. A slice mayinclude a plurality of whole (or complete) tiles or a plurality ofconsecutive (or contiguous) CTU matrices within one tile of a picturethat may be included in one NAL unit. In the present specification, atile group and a slice may be interchangeably used. For example, in thepresent specification, a tile group/tile group header may be referred toas a slice/slice header.

Meanwhile, one picture may be divided into two or more subpictures. Asubpicture may be a rectangular region of one or more slices within apicture.

A pixel or a pel may mean a smallest unit constituting one picture (orimage). Also, ‘sample’ may be used as a term corresponding to a pixel. Asample may generally represent a pixel or a value of a pixel, and mayrepresent only a pixel/pixel value of a luma component or only apixel/pixel value of a chroma component.

A unit may represent a basic unit of image processing. The unit mayinclude at least one of a specific region of the picture and informationrelated to the region. One unit may include one luma block and twochroma (e.g., cb, cr) blocks. The unit may be used interchangeably withterms such as block or area in some cases. In a general case, an M×Nblock may include samples (or sample arrays) or a set (or array) oftransform coefficients of M columns and N rows.

FIG. 2 is a diagram schematically illustrating a configuration of avideo/image encoding apparatus to which the present disclosure isapplicable. Hereinafter, a video encoding apparatus may include an imageencoding apparatus.

Referring to FIG. 2 , the encoding apparatus 200 includes an imagepartitioner 210, a predictor 220, a residual processor 230, and anentropy encoder 240, an adder 250, a filter 260, and a memory 270. Thepredictor 220 may include an inter predictor 221 and an intra predictor222. The residual processor 230 may include a transformer 232, aquantizer 233, a dequantizer 234, and an inverse transformer 235. Theresidual processor 230 may further include a subtractor 231. The adder250 may be called a reconstructor or a reconstructed block generator.The image partitioner 210, the predictor 220, the residual processor230, the entropy encoder 240, the adder 250, and the filter 260 may beconfigured by at least one hardware component (e.g., an encoder chipsetor processor) according to an embodiment. In addition, the memory 270may include a decoded picture buffer (DPB) or may be configured by adigital storage medium. The hardware component may further include thememory 270 as an internal/external component.

The image partitioner 210 may partition an input image (or a picture ora frame) input to the encoding apparatus 200 into one or moreprocessors. For example, the processor may be called a coding unit (CU).In this case, the coding unit may be recursively partitioned accordingto a quad-tree binary-tree ternary-tree (QTBTTT) structure from a codingtree unit (CTU) or a largest coding unit (LCU). For example, one codingunit may be partitioned into a plurality of coding units of a deeperdepth based on a quad tree structure, a binary tree structure, and/or aternary structure. In this case, for example, the quad tree structuremay be applied first and the binary tree structure and/or ternarystructure may be applied later. Alternatively, the binary tree structuremay be applied first. The coding procedure according to the presentdisclosure may be performed based on the final coding unit that is nolonger partitioned. In this case, the largest coding unit may be used asthe final coding unit based on coding efficiency according to imagecharacteristics, or if necessary, the coding unit may be recursivelypartitioned into coding units of deeper depth and a coding unit havingan optimal size may be used as the final coding unit. Here, the codingprocedure may include a procedure of prediction, transform, andreconstruction, which will be described later. As another example, theprocessor may further include a prediction unit (PU) or a transform unit(TU). In this case, the prediction unit and the transform unit may besplit or partitioned from the aforementioned final coding unit. Theprediction unit may be a unit of sample prediction, and the transformunit may be a unit for deriving a transform coefficient and/or a unitfor deriving a residual signal from the transform coefficient.

The unit may be used interchangeably with terms such as block or area insome cases. In a general case, an M×N block may represent a set ofsamples or transform coefficients composed of M columns and N rows. Asample may generally represent a pixel or a value of a pixel, mayrepresent only a pixel/pixel value of a luma component or represent onlya pixel/pixel value of a chroma component. A sample may be used as aterm corresponding to one picture (or image) for a pixel or a pel.

In the encoding apparatus 200, a prediction signal (predicted block,prediction sample array) output from the inter predictor 221 or theintra predictor 222 is subtracted from an input image signal (originalblock, original sample array) to generate a residual signal residualblock, residual sample array), and the generated residual signal istransmitted to the transformer 232. In this case, as shown, a part forsubtracting a prediction signal (predicted block, prediction samplearray) from the input image signal (original block, original samplearray) in the encoder 200 may be called a subtractor 231. The predictormay perform prediction on a block to be processed (hereinafter, referredto as a current block) and generate a predicted block includingprediction samples for the current block. The predictor may determinewhether intra prediction or inter prediction is applied on a currentblock or CU basis. As described later in the description of eachprediction mode, the predictor may generate various information relatedto prediction, such as prediction mode information, and transmit thegenerated information to the entropy encoder 240. The information on theprediction may be encoded in the entropy encoder 240 and output in theform of a bitstream.

The intra predictor 222 may predict the current block by referring tothe samples in the current picture. The referred samples may be locatedin the neighborhood of the current block or may be located apartaccording to the prediction mode. In the intra prediction, predictionmodes may include a plurality of non-directional modes and a pluralityof directional modes. The non-directional mode may include, for example,a DC mode and a planar mode. The directional mode may include, forexample, 33 directional prediction modes or 65 directional predictionmodes according to the degree of detail of the prediction direction.However, this is merely an example, more or less directional predictionmodes may be used depending on a setting. The intra predictor 222 maydetermine the prediction mode applied to the current block by using aprediction mode applied to a neighboring block.

The inter predictor 221 may derive a predicted block for the currentblock based on a reference block (reference sample array) specified by amotion vector on a reference picture. Here, in order to reduce theamount of motion information transmitted in the inter prediction mode,the motion information may be predicted in units of blocks, sub-blocks,or samples based on correlation of motion information between theneighboring block and the current block. The motion information mayinclude a motion vector and a reference picture index. The motioninformation may further include inter prediction direction (L0prediction, L1 prediction, Bi prediction, and so on) information. In thecase of inter prediction, the neighboring block may include a spatialneighboring block present in the current picture and a temporalneighboring block present in the reference picture. The referencepicture including the reference block and the reference pictureincluding the temporal neighboring block may be the same or different.The temporal neighboring block may be called a collocated referenceblock, a co-located CU (colCU), and the like, and the reference pictureincluding the temporal neighboring block may be called a collocatedpicture (colPic). For example, the inter predictor 221 may configure amotion information candidate list based on neighboring blocks andgenerate information indicating which candidate is used to derive amotion vector and/or a reference picture index of the current block.Inter prediction may be performed based on various prediction modes. Forexample, in the case of a skip mode and a merge mode, the interpredictor 221 may use motion information of the neighboring block asmotion information of the current block. In the skip mode, unlike themerge mode, the residual signal may not be transmitted. In the case ofthe motion vector prediction (MVP) mode, the motion vector of theneighboring block may be used as a motion vector predictor and themotion vector of the current block may be indicated by signaling amotion vector difference.

The predictor 220 may generate a prediction signal based on variousprediction methods described below. For example, the predictor may notonly apply intra prediction or inter prediction to predict one block butalso simultaneously apply both intra prediction and inter prediction.This may be called combined inter and intra prediction (CIIP). Inaddition, the predictor may be based on an intra block copy (IBC)prediction mode or a palette mode for prediction of a block. The IBCprediction mode or palette mode may be used for content image/videocoding of a game or the like, for example, screen content coding (SCC).The IBC basically performs prediction in the current picture but may beperformed similarly to inter prediction in that a reference block isderived in the current picture. That is, the IBC may use at least one ofthe inter prediction techniques described in the present disclosure. Thepalette mode may be considered as an example of intra coding or intraprediction. When the palette mode is applied, a sample value within apicture may be signaled based on information on the palette table andthe palette index.

The prediction signal generated by the predictor (including the interpredictor 221 and/or the intra predictor 222) may be used to generate areconstructed signal or to generate a residual signal. The transformer232 may generate transform coefficients by applying a transformtechnique to the residual signal. For example, the transform techniquemay include at least one of a discrete cosine transform (DCT), adiscrete sine transform (DST), a karhunen-loéve transform (KLT), agraph-based transform (GBT), or a conditionally non-linear transform(CNT). Here, the GBT means transform obtained from a graph whenrelationship information between pixels is represented by the graph. TheCNT refers to transform generated based on a prediction signal generatedusing all previously reconstructed pixels. In addition, the transformprocess may be applied to square pixel blocks having the same size ormay be applied to blocks having a variable size rather than square.

The quantizer 233 may quantize the transform coefficients and transmitthem to the entropy encoder 240 and the entropy encoder 240 may encodethe quantized signal (information on the quantized transformcoefficients) and output a bitstream. The information on the quantizedtransform coefficients may be referred to as residual information. Thequantizer 233 may rearrange block type quantized transform coefficientsinto a one-dimensional vector form based on a coefficient scanning orderand generate information on the quantized transform coefficients basedon the quantized transform coefficients in the one-dimensional vectorform. Information on transform coefficients may be generated. Theentropy encoder 240 may perform various encoding methods such as, forexample, exponential Golomb, context-adaptive variable length coding(CAVLC), context-adaptive binary arithmetic coding (CABAC), and thelike. The entropy encoder 240 may encode information necessary forvideo/image reconstruction other than quantized transform coefficients(e.g., values of syntax elements, and so on) together or separately.Encoded information (e.g., encoded video/image information) may betransmitted or stored in units of NALs (network abstraction layer) inthe form of a bitstream. The video/image information may further includeinformation on various parameter sets such as an adaptation parameterset (APS), a picture parameter set (PPS), a sequence parameter set(SPS), or a video parameter set (VPS). In addition, the video/imageinformation may further include general constraint information. In thepresent disclosure, information and/or syntax elementstransmitted/signaled from the encoding apparatus to the decodingapparatus may be included in video/picture information. The video/imageinformation may be encoded through the above-described encodingprocedure and included in the bitstream. The bitstream may betransmitted over a network or may be stored in a digital storage medium.The network may include a broadcasting network and/or a communicationnetwork, and the digital storage medium may include various storagemedia such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, and the like. Atransmitter (not shown) transmitting a signal output from the entropyencoder 240 and/or a storage part (not shown) storing the signal may beincluded as internal/external element of the encoding apparatus 200, andalternatively, the transmitter may be included in the entropy encoder240.

The quantized transform coefficients output from the quantizer 233 maybe used to generate a prediction signal. For example, the residualsignal (residual block or residual samples) may be reconstructed byapplying dequantization and inverse transform to the quantized transformcoefficients through the dequantizer 234 and the inverse transformer235. The adder 250 adds the reconstructed residual signal to theprediction signal output from the inter predictor 221 or the intrapredictor 222 to generate a reconstructed signal (reconstructed picture,reconstructed block, reconstructed sample array). If there is noresidual for the block to be processed, such as a case where the skipmode is applied, the predicted block may be used as the reconstructedblock. The adder 250 may be called a reconstructor or a reconstructedblock generator. The generated reconstructed signal may be used forintra prediction of a next block to be processed in the current pictureand may be used for inter prediction of a next picture through filteringas described below.

Meanwhile, luma mapping with chroma scaling (LMCS) may be applied duringpicture encoding and/or reconstruction.

The filter 260 may improve subjective/objective image quality byapplying filtering to the reconstructed signal. For example, the filter260 may generate a modified reconstructed picture by applying variousfiltering methods to the reconstructed picture and store the modifiedreconstructed picture in the memory 270, specifically, a DPB of thememory 270. The various filtering methods may include, for example,deblocking filtering, a sample adaptive offset, an adaptive loop filter,a bilateral filter, and the like. The filter 260 may generate variousinformation related to the filtering and transmit the generatedinformation to the entropy encoder 240 as described later in thedescription of each filtering method. The information related to thefiltering may be encoded by the entropy encoder 240 and output in theform of a bitstream.

The modified reconstructed picture transmitted to the memory 270 may beused as the reference picture in the inter predictor 221. When the interprediction is applied through the encoding apparatus, predictionmismatch between the encoding apparatus 200 and the decoding apparatus300 may be avoided and encoding efficiency may be improved.

The DPB of the memory 270 DPB may store the modified reconstructedpicture for use as a reference picture in the inter predictor 221. Thememory 270 may store the motion information of the block from which themotion information in the current picture is derived (or encoded) and/orthe motion information of the blocks in the picture that have alreadybeen reconstructed. The stored motion information may be transmitted tothe inter predictor 221 and used as the motion information of thespatial neighboring block or the motion information of the temporalneighboring block. The memory 270 may store reconstructed samples ofreconstructed blocks in the current picture and may transfer thereconstructed samples to the intra predictor 222.

FIG. 3 is a diagram schematically illustrating a configuration of avideo/image decoding apparatus to which the present disclosure isapplicable.

Referring to FIG. 3 , the decoding apparatus 300 may include an entropydecoder 310, a residual processor 320, a predictor 330, an adder 340, afilter 350, a memory 360. The predictor 330 may include an interpredictor 331 and an intra predictor 332. The residual processor 320 mayinclude a dequantizer 321 and an inverse transformer 321. The entropydecoder 310, the residual processor 320, the predictor 330, the adder340, and the filter 350 may be configured by a hardware component (e.g.,a decoder chipset or a processor) according to an embodiment. Inaddition, the memory 360 may include a decoded picture buffer (DPB) ormay be configured by a digital storage medium. The hardware componentmay further include the memory 360 as an internal/external component.

When a bitstream including video/image information is input, thedecoding apparatus 300 may reconstruct an image corresponding to aprocess in which the video/image information is processed in theencoding apparatus of FIG. 2 . For example, the decoding apparatus 300may derive units/blocks based on block partition related informationobtained from the bitstream. The decoding apparatus 300 may performdecoding using a processor applied in the encoding apparatus. Thus, theprocessor of decoding may be a coding unit, for example, and the codingunit may be partitioned according to a quad tree structure, binary treestructure and/or ternary tree structure from the coding tree unit or thelargest coding unit. One or more transform units may be derived from thecoding unit. The reconstructed image signal decoded and output throughthe decoding apparatus 300 may be reproduced through a reproducingapparatus.

The decoding apparatus 300 may receive a signal output from the encodingapparatus of FIG. 2 in the form of a bitstream, and the received signalmay be decoded through the entropy decoder 310. For example, the entropydecoder 310 may parse the bitstream to derive information (e.g.,video/image information) necessary for image reconstruction (or picturereconstruction). The video/image information may further includeinformation on various parameter sets such as an adaptation parameterset (APS), a picture parameter set (PPS), a sequence parameter set(SPS), or a video parameter set (VPS). In addition, the video/imageinformation may further include general constraint information. Thedecoding apparatus may further decode picture based on the informationon the parameter set and/or the general constraint information.Signaled/received information and/or syntax elements described later inthe present disclosure may be decoded may decode the decoding procedureand obtained from the bitstream. For example, the entropy decoder 310decodes the information in the bitstream based on a coding method suchas exponential Golomb coding, CAVLC, or CABAC, and output syntaxelements required for image reconstruction and quantized values oftransform coefficients for residual. More specifically, the CABACentropy decoding method may receive a bin corresponding to each syntaxelement in the bitstream, determine a context model using a decodingtarget syntax element information, decoding information of a decodingtarget block or information of a symbol/bin decoded in a previous stage,and perform an arithmetic decoding on the bin by predicting aprobability of occurrence of a bin according to the determined contextmodel, and generate a symbol corresponding to the value of each syntaxelement. In this case, the CABAC entropy decoding method may update thecontext model by using the information of the decoded symbol/bin for acontext model of a next symbol/bin after determining the context model.The information related to the prediction among the information decodedby the entropy decoder 310 may be provided to the predictor (the interpredictor 332 and the intra predictor 331), and the residual value onwhich the entropy decoding was performed in the entropy decoder 310,that is, the quantized transform coefficients and related parameterinformation, may be input to the residual processor 320. The residualprocessor 320 may derive the residual signal (the residual block, theresidual samples, the residual sample array). In addition, informationon filtering among information decoded by the entropy decoder 310 may beprovided to the filter 350. Meanwhile, a receiver (not shown) forreceiving a signal output from the encoding apparatus may be furtherconfigured as an internal/external element of the decoding apparatus300, or the receiver may be a component of the entropy decoder 310.Meanwhile, the decoding apparatus according to the present disclosuremay be referred to as a video/image/picture decoding apparatus, and thedecoding apparatus may be classified into an information decoder(video/image/picture information decoder) and a sample decoder(video/image/picture sample decoder). The information decoder mayinclude the entropy decoder 310, and the sample decoder may include atleast one of the dequantizer 321, the inverse transformer 322, the adder340, the filter 350, the memory 360, the inter predictor 332, and theintra predictor 331.

The dequantizer 321 may dequantize the quantized transform coefficientsand output the transform coefficients. The dequantizer 321 may rearrangethe quantized transform coefficients in the form of a two-dimensionalblock form. In this case, the rearrangement may be performed based onthe coefficient scanning order performed in the encoding apparatus. Thedequantizer 321 may perform dequantization on the quantized transformcoefficients by using a quantization parameter (e.g., quantization stepsize information) and obtain transform coefficients.

The inverse transformer 322 inversely transforms the transformcoefficients to obtain a residual signal (residual block, residualsample array).

The predictor may perform prediction on the current block and generate apredicted block including prediction samples for the current block. Thepredictor may determine whether intra prediction or inter prediction isapplied to the current block based on the information on the predictionoutput from the entropy decoder 310 and may determine a specificintra/inter prediction mode.

The predictor 320 may generate a prediction signal based on variousprediction methods described below. For example, the predictor may notonly apply intra prediction or inter prediction to predict one block butalso simultaneously apply intra prediction and inter prediction. Thismay be called combined inter and intra prediction (CIIP). In addition,the predictor may be based on an intra block copy (IBC) prediction modeor a palette mode for prediction of a block. The IBC prediction mode orpalette mode may be used for content image/video coding of a game or thelike, for example, screen content coding (SCC). The IBC basicallyperforms prediction in the current picture but may be performedsimilarly to inter prediction in that a reference block is derived inthe current picture. That is, the IBC may use at least one of the interprediction techniques described in the present disclosure. The palettemode may be considered as an example of intra coding or intraprediction. When the palette mode is applied, a sample value within apicture may be signaled based on information on the palette table andthe palette index.

The intra predictor 331 may predict the current block by referring tothe samples in the current picture. The referred samples may be locatedin the neighborhood of the current block or may be located apartaccording to the prediction mode. In the intra prediction, predictionmodes may include a plurality of non-directional modes and a pluralityof directional modes. The intra predictor 331 may determine theprediction mode applied to the current block by using a prediction modeapplied to a neighboring block.

The inter predictor 332 may derive a predicted block for the currentblock based on a reference block (reference sample array) specified by amotion vector on a reference picture. In this case, in order to reducethe amount of motion information transmitted in the inter predictionmode, motion information may be predicted in units of blocks,sub-blocks, or samples based on correlation of motion informationbetween the neighboring block and the current block. The motioninformation may include a motion vector and a reference picture index.The motion information may further include inter prediction direction(L0 prediction, L1 prediction, Bi prediction, and so on) information. Inthe case of inter prediction, the neighboring block may include aspatial neighboring block present in the current picture and a temporalneighboring block present in the reference picture. For example, theinter predictor 332 may configure a motion information candidate listbased on neighboring blocks and derive a motion vector of the currentblock and/or a reference picture index based on the received candidateselection information. Inter prediction may be performed based onvarious prediction modes, and the information on the prediction mayinclude information indicating a mode of inter prediction for thecurrent block.

The adder 340 may generate a reconstructed signal (reconstructedpicture, reconstructed block, reconstructed sample array) by adding theobtained residual signal to the prediction signal (predicted block,predicted sample array) output from the predictor (including the interpredictor 332 and/or the intra predictor 331). If there is no residualfor the block to be processed, such as when the skip mode is applied,the predicted block may be used as the reconstructed block.

The adder 340 may be called reconstructor or a reconstructed blockgenerator. The generated reconstructed signal may be used for intraprediction of a next block to be processed in the current picture, maybe output through filtering as described below, or may be used for interprediction of a next picture.

Meanwhile, luma mapping with chroma scaling (LMCS) may be applied in thepicture decoding process.

The filter 350 may improve subjective/objective image quality byapplying filtering to the reconstructed signal. For example, the filter350 may generate a modified reconstructed picture by applying variousfiltering methods to the reconstructed picture and store the modifiedreconstructed picture in the memory 360, specifically, a DPB of thememory 360. The various filtering methods may include, for example,deblocking filtering, a sample adaptive offset, an adaptive loop filter,a bilateral filter, and the like.

The (modified) reconstructed picture stored in the DPB of the memory 360may be used as a reference picture in the inter predictor 332. Thememory 360 may store the motion information of the block from which themotion information in the current picture is derived (or decoded) and/orthe motion information of the blocks in the picture that have alreadybeen reconstructed. The stored motion information may be transmitted tothe inter predictor 260 so as to be utilized as the motion informationof the spatial neighboring block or the motion information of thetemporal neighboring block. The memory 360 may store reconstructedsamples of reconstructed blocks in the current picture and transfer thereconstructed samples to the intra predictor 331.

In the present document, the embodiments described in the filter 260,the inter predictor 221, and the intra predictor 222 of the encodingapparatus 200 may be the same as or respectively applied to correspondto the filter 350, the inter predictor 332, and the intra predictor 331of the decoding apparatus 300. The same may also apply to the interpredictor 332 and the intra predictor 331.

As described above, in video coding, prediction is performed to increasecompression efficiency. Through this, it is possible to generate apredicted block including prediction samples for a current block, whichis a block to be coded. Here, the predicted block includes predictionsamples in a spatial domain (or pixel domain). The predicted block isderived equally from the encoding device and the decoding device, andthe encoding device decodes information (residual information) on theresidual between the original block and the predicted block, not theoriginal sample value of the original block itself. By signaling to thedevice, image coding efficiency can be increased. The decoding apparatusmay derive a residual block including residual samples based on theresidual information, and generate a reconstructed block includingreconstructed samples by summing the residual block and the predictedblock, and generate a reconstructed picture including reconstructedblocks.

The residual information may be generated through transformation andquantization processes. For example, the encoding apparatus may derive aresidual block between the original block and the predicted block, andperform a transform process on residual samples (residual sample array)included in the residual block to derive transform coefficients, andthen, by performing a quantization process on the transformcoefficients, derive quantized transform coefficients to signal theresidual related information to the decoding apparatus (via abitstream). Here, the residual information may include locationinformation, a transform technique, a transform kernel, and aquantization parameter, value information of the quantized transformcoefficients, and so on. The decoding apparatus may performdequantization/inverse transformation process based on the residualinformation and derive residual samples (or residual blocks). Thedecoding apparatus may generate a reconstructed picture based on thepredicted block and the residual block. The encoding apparatus may alsodequantize/inverse transform the quantized transform coefficients forreference for inter prediction of a later picture to derive a residualblock, and generate a reconstructed picture based thereon. In thepresent document, at least one of quantization/dequantization and/ortransform/inverse transform may be omitted. When thequantization/dequantization is omitted, the quantized transformcoefficient may be referred to as a transform coefficient. When thetransform/inverse transform is omitted, the transform coefficients maybe called coefficients or residual coefficients, or may still be calledtransform coefficients for uniformity of expression. In the presentdocument, a quantized transform coefficient and a transform coefficientmay be referred to as a transform coefficient and a scaled transformcoefficient, respectively. In this case, the residual information mayinclude information on transform coefficient(s), and the information onthe transform coefficient(s) may be signaled through residual codingsyntax. Transform coefficients may be derived based on the residualinformation (or information on the transform coefficient(s)), and scaledtransform coefficients may be derived through inverse transform(scaling) on the transform coefficients. Residual samples may be derivedbased on an inverse transform (transform) of the scaled transformcoefficients. This may be applied/expressed in other parts of thepresent document as well.

FIG. 4 exemplarily shows a hierarchical structure for a coded data.

Referring to FIG. 4 , the coded data may be divided into a video codinglayer (VCL), which handles coding processing of a video/image and thevideo/image itself, and a Network abstraction layer (NAL), which isexists between the VCL and a sub-system that stores and transmits thecoded video/image.

The VCL may generate a parameter set (picture parameter set (PPS),sequence parameter set (SPS), video parameter set (VPS), and so on)corresponding to a header of a sequence and a picture, and so on, and asupplemental enhancement information (SEI) message that is additionallyneeded in the coding process of the video/image. The SEI message sseparated from the information on the video/image (slice data). The VCLincluding the information on the video/image is configured of slice dataand a slice header. Meanwhile, a slice header may be referred to as atile group header, and slice data may be referred to as tile group data.

In the NAL, a NAL unit may be generated by adding header information(NAL unit header) to a raw byte sequence payload (RBSP) generated in aVCL. In this case, the RBSP refers to slice data, parameter set, SEImessage, and so on, generated in the VCL. The NAL unit header mayinclude NAL unit type information specified according to RB SP dataincluded in the corresponding NAL unit.

A NAL unit performs a role of mapping a coded image to bit sequence of asub-system, such as a file format, Real-time Transport Protocol (RTP),transport stream (TS), and so on.

As shown in the figure, the NAL unit may be classified into a VCL NALunit and a Non-VCL NAL unit according to the RB SP generated in the VCL.The VCL NAL unit may mean a NAL unit that includes information on theimage (slice data) on the image, and the Non-VCL NAL unit may mean a NALunit that includes information (parameter set or SEI message) requiredfor decoding the image.

The above-described VCL NAL unit and Non-VCL NAL unit may be transmittedthrough a network by attaching header information according to the datastandard of the subsystem. For example, the NAL unit may be transformedinto a data format of a predetermined standard such as an H.266/VVC fileformat, a real-time transport protocol (RTP), a transport stream (TS),and so on, and transmitted through various networks.

As described above, the NAL unit may be specified with the NAL unit typeaccording to the RB SP data structure included in the corresponding NALunit, and information on the NAL unit type may be stored and signaled inthe NAL unit header.

For example, the NAL unit may be classified into a VCL NAL unit type anda Non-VCL NAL unit type according to whether the NAL unit includesinformation (slice data) about an image. The VCL NAL unit type may beclassified according to the nature and type of pictures included in theVCL NAL unit, and the Non-VCL NAL unit type may be classified accordingto types of parameter sets.

The following is an example of a NAL unit type that is specified inaccordance with a parameter set type that is included in a Non-VCL NALunit type. For example, the NAL unit type may be specified as one of anAdaptation Parameter Set (APS) NAL unit, which is a NAL unit typeincluding APS, a Decoding Parameter Set (DPS) NAL unit, which is a NALunit type including DPS, a Video Parameter Set (VPS) NAL unit, which isa NAL unit type including VPS, a Sequence Parameter Set (SPS) NAL unit,which is a NAL unit type including SPS, and a Picture Parameter Set(PPS) NAL unit, which is a NAL unit type including PPS.

The aforementioned NAL unit types may have syntax information for theNAL unit type, and the syntax information may be stored and signaled ina NAL unit header. For example, the syntax information may be nal_unittype, and NAL unit types may be specified by a nal_unit type value.

Meanwhile, as described above, one picture may include a plurality ofslices, and one slice may include a slice header and slice data. In thiscase, one picture header may be further added to a plurality of slices(a slice header and a slice data set) in one picture. The picture header(picture header syntax) may include information/parameters commonlyapplicable to the picture. The slice header (slice header syntax) mayinclude information/parameters that may be commonly applied to theslice. The APS (APS syntax) or the PPS (PPS syntax) may includeinformation/parameters that may be commonly applied to one or moreslices or pictures. The SPS (SPS syntax) may includeinformation/parameters that may be commonly applied to one or moresequences. The VPS (VPS syntax) may include information/parameters thatmay be commonly applied to multiple layers. The DPS (DPS syntax) mayinclude information/parameters that may be commonly applied to theoverall video. The DPS may include information/parameters related toconcatenation of a coded video sequence (CVS). The high level syntax(HLS) in the present document may include at least one of the APSsyntax, the PPS syntax, the SPS syntax, the VPS syntax, the DPS syntax,and the slice header syntax.

In the present document, the image/image information encoded from theencoding apparatus and signaled to the decoding apparatus in the form ofa bitstream includes not only partitioning related information in apicture, intra/inter prediction information, residual information,in-loop filtering information, and so on, but also information includedin a slice header, information included in the APS, information includedin the PPS, information included in an SPS, information included in theVPS and/or information included in the DPS. In addition, the image/imageinformation may further include NAL unit header information.

FIG. 5 is a diagram illustrating an example of a candidate block thatmay be used in a case where inter prediction for a current block isperformed.

A predictor of an encoding apparatus and a decoding apparatus may use ablock that is positioned at a predetermined neighboring location fromthe current block 500 as a candidate block. For example, in the exampleof FIG. 5 , two blocks A0 510 and A1 520 being located at a bottom-leftside of the current block and three blocks B0 530, B1 540, and B2 550being located at a top-right side and a top-left side of the currentblock may be selected as spatial candidate blocks. Additionally, apartfrom the spatially adjacent blocks, as a temporal candidate block, theabove-described Col block 560 may be used as a candidate block.

Meanwhile, in relation to a reference picture that is used in interprediction, a reference picture for the current block may be derivedfrom a reference picture of a neighboring block or may be indicated byinformation that is received from the encoding apparatus. In case of askip mode or a merge mode, the predictor of the decoding apparatus mayuse a reference picture of a neighboring block as a reference picture ofthe current block. In case MVP is applied, the predictor of the decodingapparatus may receive information indicating a reference picture for thecurrent block.

Previously encoded/decoded pictures prior to the current picture arestored in the memory (e.g., Decoded Picture Buffer (DPB)) and may beused for the prediction of the current block (current picture). Picturesthat are available for usage in the inter prediction of the currentblock may be maintained in a reference picture list. At this point,among the reference pictures that are included in the reference picturelist, a reference picture that is used for the inter prediction of thecurrent block may be indicated by a reference picture index. That is, areference picture index may mean an index indicating a reference picturethat is used for the inter prediction of the current block, among thereference pictures configuring (or constructing) the reference picturelist.

I slice is a slice that is decoded via intra prediction. P slice is aslice that is decoded via intra prediction or inter prediction, whichuses a maximum of one motion vector and one reference picture. B sliceis a slice that is decoded via intra prediction or inter prediction,which uses a maximum of two motion vectors and two reference pictures.At this point, a reference picture may include a Short Term ReferencePicture (STRP) (hereinafter referred to as “STRP”) and a Long TermReference Picture (LTRP) (hereinafter referred to as “LTRP”).

Herein, a STRP and an LTRP may be reconstructed pictures that are storedin the Decoded Picture Buffer (DPB). The STRP may be marked as “used forshort-term reference” or “used for reference”. Additionally, the LTRPmay be marked as “used for long-term reference” or “used for reference”.For example, a POC difference between a decoding target picture and along-term reference picture (LTRP) may be given a value corresponding toa range from ‘1’ to ‘224-1’. Herein, a Picture Order Count (POC) mayindicate a picture display order.

Reference picture list 0 (hereinafter referred to as ‘L0’ for simplicityin the description) is a reference picture list that is used for interprediction of P slice or B slice. Reference picture list 1 (hereinafterreferred to as ‘L1’ for simplicity in the description) may be used forinter prediction of B slice. Therefore, when performing inter predictionfor a block of P slice, a one-direction (or single direction) predictionthat is based on L0 may be performed. And, when performing interprediction for a block of B slice, a bi-prediction may be performedbased on L0 and L1.

When performing encoding and/or decoding on P slice and B slice viainter prediction, the encoding apparatus and/or decoding apparatus mayconstruct a reference picture list. At this point, a reference picturethat is used for inter prediction may be designated by a referencepicture index. As described above, a reference picture index may mean anindex that indicates a reference picture within a reference picture listthat is used for inter prediction.

A reference picture list may be constructed based on a reference pictureset that is determined or generated by the encoding apparatus and thedecoding apparatus. Reference pictures that construct the referencepicture list may be stored in the memory (e.g., DPB). The pictures thatare stored in the memory (previously encoded/decoded pictures prior tothe current picture) may be managed by the encoding apparatus and thedecoding apparatus.

Meanwhile, as described above, in order to enhance subjective/objectivepicture quality, the encoding apparatus/decoding apparatus may performan in-loop filtering procedure for a reconstructed picture. A modifiedreconstructed picture may be generated through the in-loop filteringprocedure, and the modified reconstructed picture may be outputted fromthe decoding apparatus as a decoded picture and may also be stored inthe decoded picture buffer or memory of the encoding apparatus/thedecoding apparatus. Additionally, in a later process, the modifiedreconstructed picture may be used as a reference picture in an interprediction procedure when performing encoding/decoding. As describedabove, the in-loop filtering procedure may include a deblockingfiltering procedure, a sample adaptive offset (SAO) procedure, and/or anadaptive loop filter (ALF) procedure. In this case, one or part of thedeblocking filtering procedure, the sample adaptive offset (SAO)procedure, and the adaptive loop filter (ALF) procedure may besequentially applied, or all of the procedures may be sequentiallyapplied. For example, after applying the deblocking filtering procedureto a reconstructed picture, the SAO procedure may be performed.Alternatively, for example, after applying the deblocking filteringprocedure to the reconstructed picture, the ALF procedure may beperformed. This may be identically performed in the encoding apparatus.

The deblocking filtering procedure is a procedure that removes anydistortion generated a reconstructed picture at a boundary betweenblocks. For example, the deblocking filtering procedure may derive atarget boundary from the reconstructed picture, determine a boundarystrength (bS) for the target boundary, and perform deblocking filteringfor the target boundary based on the determined bS. The bS may bedetermined based on the prediction modes of two blocks being adjacent tothe target block, a motion vector difference, whether or not thereference picture is the same, whether or not a non-zero significantcoefficient exists, and so on.

The SAO procedure is a method for compensating an offset differentbetween a reconstructed picture and an original picture in sample units.For example, the SAO procedure may be applied in accordance to an offsettype, such as a band offset, an edge offset, and so on. According to theSAO, a sample may be sorted as different categories in accordance withthe SAO type, and an offset value may be added to each sample inaccordance with the category. Filtering information for the SAO mayinclude information on the application or non-application of SAO, SAOtype information, and SAO offset value information. For example, the SAOmay be applied to a reconstructed picture after the application ofdeblocking filtering.

The adaptive loop filter (ALF) procedure is a procedure for filtering areconstructed picture in sample units, based on a filter coefficientaccording to a filter shape. The encoding apparatus may compare thereconstructed picture with the original picture so as to determinewhether or not to apply the ALF, the ALF shape, and/or the ALF filteringcoefficient, and so on, and may signal the reconstructed picture to theencoding apparatus. That is, the filtering information on the ALFprocedure may include information on whether or not to apply the ALF,ALF shape information, ALF filtering coefficient information, and so on.The ALF procedure may be applied to a reconstructed picture after theapplication of deblocking filtering.

FIG. 6 is a flowchart illustrating a method for performing deblockingfiltering.

As described above, the encoding apparatus/decoding apparatus mayreconstruct a picture in block units. When performing such imagereconstruction in block units, a block distortion may occur at aboundary between blocks within the reconstructed picture. Therefore, inorder to remove the block distortion that occurs at the boundary betweenblocks within the reconstructed picture, the encoding apparatus and thedecoding apparatus may use a deblocking filter.

Therefore, the encoding apparatus/decoding apparatus may derive aboundary between blocks having deblocking filtering performed thereinwithin the reconstructed picture. Meanwhile, a boundary havingdeblocking filtering performed therein may be referred to as an edge.Additionally, the boundary having deblocking filtering performed thereinmay include two different types, and the two different types ofboundaries may be a vertical boundary and a horizontal boundary. Thevertical boundary may also be referred to as a vertical edge, and thehorizontal boundary may also be referred to as a horizontal edge. Theencoding apparatus/decoding apparatus may perform deblocking filteringon the vertical edge and may also perform deblocking filtering on thehorizontal edge.

For example, the encoding apparatus/decoding apparatus may derive atarget boundary that is to be processed with filtering from thereconstructed picture (S610).

Additionally, the decoding apparatus/decoding apparatus may determine aboundary strength (bS) for a boundary having deblocking filteringperformed therein (S620). The bS may also be indicated as a boundaryfiltering strength. For example, a case where a bS value for a boundary(block edge) between block P and block Q is obtained may be assumed. Inthis case, the encoding apparatus/decoding apparatus may obtain a bSvalue for a boundary (block edge) between block P and block Q based onthe block P and the block Q. For example, bS may be determined inaccordance with the table shown below.

TABLE 1 The variable bS[ xD 

  ][ yD 

  ] is derived as fallows: - If cIdx is equal to 0 and both samples p₀and q₀ are in a coding block with intra_bdpcm_flag equal to 1, bS[ xD 

  ][ yD 

  ] is set equal to 0. - Otherwise, if the sample p₀ or q₀ is in thecoding block of a coding unit coded with intra prediction mode, bS[ xD 

  ][ yD 

  ] is set equal to 2. - Otherwise, if the block edge is also atransform block edge and the sample p₀ or q₀ is in a coding block withciip_flag equal to 1 

  bS[ xD 

  ][ yD 

  ] is set equal to 2 

  - Otherwise, if the block edge is also a transform block edge and thesample p₀ or q₀ is in a transform block which contains one or morenon-zero transform coefficient levels, bS[ xD 

  ][ yD 

  ] is set equal to 1. - Otherwise, if the prediction mode of the codingsubblock containing the sample p₀ is different from the prediction modeof the coding subblock containing the sample q₀, bS[ xD 

  ][ yD 

  ] is set equal to 1. - Otherwise, if cIdx is equal to 0 and one ormore of the following conditions are true, bS[ xD 

  ][ yD 

  ] is set equal to 1:  - The coding subblock containing the sample p₀and the coiling subblock containing the sample q₀ are both coded in IBCprediction mode, and the absolute difference between the horizontal orvertical component of the motion vectors used in the prediction of thetwo coding subblocks is greater than or equal to 4 in units of quarterluma samples.  - For the prediction of the coding subblock containingthe sample p₀ different reference pictures or a different number ofmotion vectors are used than for the prediction of the coding subblockcontaining the sample q₀.  - One motion vector is used to predict thecoding subblock containing the sample p₀ and one motion vector is usedto predict the coding subblock containing the sample q₀, and theabsolute difference between the horizontal or vertical component of themotion vectors used is greater than or equal to 4 in units of quarterluma samples.  - Two motion vectors and two different referencepictures: are used to predict the coding subblock containing the samplep₀, two motion vectors for the same two reference pictures are used topredict the coding subblock containing the sample q₀ and the absolutedifference between the horizontal or vertical component of the twomotion vectors used in the prediction of the two coding subblocks forthe same reference picture is greater than or equal to 4 in units ofquarter luma samples.  - Two motion vectors for the same referencepicture are used to predict the coding subblock containing the samplep₀, two motion vectors for the same reference picture are used topredict the coding subblock containing the sample q₀ and both of toefollowing- conditions are true:   - The absolute difference between thehorizontal or vertical component of list 0 motion vectors used in theprediction of the two coding subblocks is greater than or equal to 4 inquarter luma samples, or the absolute difference between the horizontalor vertical component of the list 1 motion vectors used in theprediction of the two coding subblocks is greater than or equal to 4 inunits of quarter luma samples.   - The absolute difference between thehorizontal or vertical component of list 0 motion vector used in theprediction of the coding subblock containing the sample p₀ and the list1 motion vector used; in the prediction of the coding subblockcontaining the sample q₀ is greater than or equal to 4 in units ofquarter luma samples. or the absolute difference between the horizontalor vertical component of the list 1 motion vector used in the predictionof the coding subblock containing the sample p₀ and list 0 motion vectorused in the prediction of the coding subblock containing the sample q₀is greater than or equal to 4 in units of quarter luma samples. -Otherwise, the variable bS[ xD 

  ][ yD 

  ] is set equal to 0.

indicates data missing or illegible when filed

Herein, p may indicate a sample of block P that is adjacent to thedeblocking filtering target boundary, and q may indicate a sample ofblock Q that is adjacent to the deblocking filtering target boundary.

Additionally, for example, the p0 may indicate a sample of a block thatis adjacent to a left side or top side of the deblocking filteringtarget boundary, and the q0 may indicate a sample of a block that isadjacent to a right side or bottom side of the deblocking filteringtarget boundary. For example, in case a direction of the target boundaryis vertical (i.e., in case the target boundary is a vertical boundary),the p0 may indicate a sample of a block that is adjacent to the leftside of the deblocking filtering target boundary, and the q0 mayindicate a sample of a block that is adjacent to the right side of thedeblocking filtering target boundary. Alternatively, for example, incase a direction of the target boundary is horizontal (i.e., in case thetarget boundary is a horizontal boundary), the p0 may indicate a sampleof a block that is adjacent to the top side of the deblocking filteringtarget boundary, and the q0 may indicate a sample of a block that isadjacent to the bottom side of the deblocking filtering target boundary.

Referring back to FIG. 6 , the encoding apparatus/decoding apparatus mayperform blocking filtering based on the bS (S630). For example, when thebS value is equal to 0, deblocking filtering is not applied to thetarget boundary. Meanwhile, based on the determined bS value, the filterthat is applied to the boundary between blocks may be determined. Thefilter may be categorized as a strong filter and a weak filter. Byperforming filtering using different filters for each of a boundary of aposition with a high likelihood of having block distortion occur thereinand a boundary of a position with a low likelihood of having blockdistortion occur therein within the reconstructed picture, the encodingapparatus/decoding apparatus may increase coding efficiency.

FIG. 7 is a flowchart schematically illustrating an example of an ALFprocess. The ALF process disclosed in FIG. 7 may be performed in anencoding apparatus and a decoding apparatus. In this document, thecoding apparatus may include the encoding apparatus and/or the decodingapparatus.

Referring to FIG. 7 , the coding apparatus derives a filter for ALF(S710). The filter may include filter coefficients. The coding apparatusmay determine whether to apply the ALF, and when determining to applythe ALF, may derive a filter including filter coefficients for the ALF.Information for deriving a filter (coefficients) for ALF or a filter(coefficients) for ALF may be referred to as an ALF parameter.Information on whether ALF is applied (i.e., ALF enabled flag) and ALFdata for deriving the filter may be signaled from the encoding apparatusto the decoding apparatus. ALF data may include information for derivinga filter for the ALF. Also, for example, for hierarchical control ofALF, an ALF enabled flag may be signaled at the SPS, picture header,slice header, and/or CTB level, respectively.

In order to derive the filter for the ALF, the activity and/ordirectivity of the current block (or ALF target block) is derived, andthe filter may be derived based on the activity and/or thedirectionality. For example, the ALF process may be applied in units of4×4 blocks (based on luma components). The current block or the ALFtarget block may be, for example, a CU, or may be a 4×4 block within aCU. Specifically, for example, filters for ALF may be derived based onfirst filters derived from information included in the ALF data andpredefined second filters, and the coding apparatus may select one ofthe filters based on the activity and/or the directionality. The codingapparatus may use filter coefficients included in the selected filterfor the ALF.

The coding apparatus performs filtering based on the filter (S720).Modified reconstructed samples may be derived based on the filtering.For example, the filter coefficients in the filter may be arranged orallocated according to a filter shape, and the filtering may beperformed on reconstructed samples in the current block. Here, thereconstructed samples in the current block may be reconstructed samplesafter the deblocking filter process and the SAO process are completed.For example, one filter shape may be used, or one filter shape may beselected and used from among a plurality of predetermined filter shapes.For example, a filter shape applied to the luma component and a filtershape applied to the chroma component may be different. For example, a7×7 diamond filter shape may be used for the luma component, and a 5×5diamond filter shape may be used for the chroma component.

FIG. 8 illustrates an example of a filter shape for ALF. C0-C11 of (a)and C0-05 of (b) may be filter coefficients that are depend on positionswithin each filter shape.

The (a) of FIG. 8 shows the shape of a 7×7 diamond filter, and the (b)of FIG. 8 shows the shape of a 5×5 diamond filter. In FIG. 8 , Cn in thefilter shape represents a filter coefficient. When n in Cn is the same,this indicates that the same filter coefficients can be assigned. In thepresent document, a position and/or unit to which filter coefficientsare assigned according to the filter shape of the ALF may be referred toas a filter tab. In this case, one filter coefficient may be assigned toeach filter tap, and the arrangement of the filter taps may correspondto a filter shape. A filter tab located at the center of the filtershape may be referred to as a center filter tab. The same filtercoefficients may be assigned to two filter taps of the same n value thatexist at positions corresponding to each other with respect to thecenter filter tap. For example, in the case of a 7×7 diamond filtershape, 25 filter taps are included, and since filter coefficients C0 toC11 are assigned in a centrally symmetric form, filter coefficients maybe assigned to the 25 filter taps using only 13 filter coefficients.Also, for example, in the case of a 5×5 diamond filter shape, 13 filtertaps are included, and since filter coefficients C0 to C5 are assignedin a centrally symmetrical form, filter coefficients may be assigned tothe 13 filter taps using only 7 filter coefficients. For example, inorder to reduce the data amount of signaled information on filtercoefficients, 12 filter coefficients among 13 filter coefficients forthe 7×7 diamond filter shape may be signaled (explicitly), and onefilter coefficient may be derived (implicitly). Also, for example, 6filter coefficients among 7 filter coefficients for a 5×5 diamond filtershape may be signaled (explicitly) and one filter coefficient may bederived (implicitly).

According to an embodiment of the present document, the ALF parameterused for the ALF process may be signaled through an adaptation parameterset (APS). The ALF parameter may be derived from filter information forthe ALF or ALF data.

The ALF is a type of in-loop filtering technique that can be applied invideo/image coding as described above. The ALF may be performed using aWiener-based adaptive filter. This may be to minimize a mean squareerror (MSE) between original samples and decoded samples (orreconstructed samples). A high level design for an ALF tool mayincorporate syntax elements accessible from the SPS and/or slice header(or tile group header).

Meanwhile, a picture header includes syntax elements being applied tothe picture header, and the syntax elements may be applied to all slicesof a picture that is related to the picture header. When a specificsyntax element is applied only to a specific slice, the specific syntaxelement should be signaled from a slice header and not the pictureheader.

In the prior art, signaling of a control flag and parameters forenabling or disabling multiple tools for picture encoding or decodingexisted in the picture header and were overridden in the slice header.This method provides flexibility that allows tool control to beperformed at both the picture level and the slice level. However, whenusing this method, since the slice header is required to be verifiedafter verifying the picture header, this method may burden the decoder.

Accordingly, the embodiment of the present disclosure proposesindication information indicating whether or not at least one tool isbeing applied at a picture level or a slice level. At this point, theindication information may be included in any one of a SequenceParameter Set (SPS) and a Picture Parameter Set (PPS). That is, when aspecific tool is activated (or enabled) within a CLVS, an indication orflag for indicating whether or not the specific tool is being applied ata picture level or a slice level may be signaled from a parameter set,such as SPS or PPS. Although the indication or flag may correspond toone tool, the present disclosure will not be limited only to this. Forexample, an indication or flag for indicating whether or not all tools,and not only a specific tool, are being applied at a picture level or aslice level may be signaled from a parameter set, such as SPS or PPS.

Although the control flag and parameters for enabling or disabling toolsmay be signaled at a picture level or slice level, the signaling is notperformed at both the picture level and the slice level. For example, incase of obtaining indication information indicating whether or not aspecific tool is being applied at a picture level, the control flag andparameters for enabling or disabling the specific tool may be signaledonly from the picture header. Similarly, in case of obtaining indicationinformation indicating whether or not a specific tool is being appliedat a slice level, the control flag and parameters for enabling ordisabling the specific tool may be signaled only from the slice level.

Additionally, for example, a tool that is designated to be applied at apicture level from a specific parameter set may be designated to beapplied at a slice level from another parameter set of the same type.

For example, a PPS syntax including indication information may be asshown below in the following table.

TABLE 2 pic_parameter_set_rbsp( ) { Descriptor  ...  rpl_presentin_ph_flag u( 

 )  sao_present_in_ph_flag u( 

 )  alf_present_in_ph_flag u( 

 )  deblocking_filter_control_present_flag u( 

 )  if( deblocking_filter_control_present_flag ) {  deblocking_filter_ph_override_enabled_flag u( 

 )   deblocking_filter_sh_override_enabled flag u( 

 )   pps_deblocking_filter_disabled_flag u( 

 )   if( !pps_deblocking_filter_disabled_flag ) {   pps_beta_offset_div2 se(v)    pps_tc_offset_div2 se(v)   }  } constant_slice_header_params_enabled_flag u( 

 )  ... }

indicates data missing or illegible when filed

Semantics of syntax elements included in the syntax of Table 2 may, forexample, be indicated as shown below in Table 3.

TABLE 3 rpl_present_in_ph_flag equal to 1 specifies the referencepicture list signalling may be present in the PHs referring to the PPS.rpl_present_in_ph_flag equal to 0 specifies the reference picture listsignalling may be present in the slice headers referring to the PPS.sao_present_in_ph_flag equal to 1 specifies the syntax elements forenabling SAO use may be present in the PHs referring to the PPS.sao_present_in_ph_flag equal to 0 specifies the syntax elements forenabling SAO use may be present in the slice headers referring to thePPS. alf_present_in_ph_flag equal to 1 specifies the syntax elements forenabling ALF use may be present in the PHs referring to the PPS.alf_present in_ph_flag equal to 0 specifies the syntax elements forenabling ALF use may be present in the slice headers referring to thePPS. deblocking_filter_ph_override_enabled_flag equal to 1 specifies thepresence of pic_deblocking_filter_override_flag in the PHs referring tothe PPS. deblocking_filter_ph_override_enabled_flag equal to 0 specifiesthe absence of pic_deblocking_filter_override_flag in PHs referring tothe PPS. When not present, the value ofdeblocking_filter_ph_override_enabled_flag is inferred to be equal to 0.deblocking_filter_sh_override_enabled_flag equal to  

  specifies the presence of slice_deblocking_filter_override_flag in theslice headers referring to the PPS.deblocking_filter_sh_override_enabled_flag equal to 0 specifies theabsence of slice_deblocking_filter_override_flag in slice headersreferring to the PPS. When not present, the value ofdeblocking_filter_sh_override_enabled_flag is inferred to be equal to 0.It is a requirement of bitstream conformance that, the value ofdeblocking_filter_ph_override_enabled_flag anddeblocking_filter_sh_override_enabled_flag shall not both be equal to 1.

indicates data missing or illegible when filed

Referring to the tables that are presented above, indication informationmay include a flag indicating whether or not signaling of a referencepicture list is applied at a picture level or a slice level. Forexample, the indication information may designate whether informationrelated to the signaling of a reference picture list is present (orexists) in the picture header or is present (or exists) in the sliceheader. For example, the flag may be indicated as rpl_present_in_phflag. Based on a case where a value of the corresponding flag is equalto 1, the information related to the signaling of a reference picturelist is present in the picture header. And, based on a case where avalue of the corresponding flag is equal to 0, the information relatedto the signaling of a reference picture list is present in the sliceheader.

Additionally, the indication information may include a flag indicatingwhether or not a Sample Adaptive Offset (SAO) procedure is being appliedat a picture level or a slice level. For example, the indicationinformation may designate whether information related to the SAOprocedure is present (or exists) in the picture header or is present (orexists) in the slice header. For example, the flag may be indicated assao_present_in_ph flag. Based on a case where a value of thecorresponding flag is equal to 1, the information related to the SAOprocedure is present in the picture header. And, based on a case where avalue of the corresponding flag is equal to 0, the information relatedto the SAO procedure is present in the slice header.

Additionally, the indication information may include a flag indicatingwhether or not an Adaptive Loop Filter (ALF) procedure is being appliedat a picture level or a slice level. For example, the indicationinformation may designate whether information related to the ALFprocedure is present (or exists) in the picture header or is present (orexists) in the slice header. For example, the flag may be indicated asalf_present_in_ph flag. Based on a case where a value of thecorresponding flag is equal to 1, the information related to the ALFprocedure is present in the picture header. And, based on a case where avalue of the corresponding flag is equal to 0, the information relatedto the ALF procedure is present in the slice header.

Additionally, the indication information may include at least one flagindicating whether or not a deblocking procedure is being applied at apicture level or a slice level. For example, based on the at least oneflag, information related to the deblocking procedure may be present (ormay exist) in any one of the picture header and a slice header. Forexample, the at least one flag may be indicated asdeblocking_filter_ph_override_enabled_flag ordeblocking_filter_sh_override_enabled_flag. For example, based on a casewhere a value of the at least one flag is equal to 1, a flag indicatingwhether or not a parameter related to the deblocking procedure ispresent in the picture header may be present in the picture header. And,based on a case where a value of the at least one flag is equal to 0, aflag indicating whether or not a parameter related to the deblockingprocedure is present in the picture header may not be present in thepicture header.

Alternatively, based on a case where a value of the at least one flag isequal to 1, a flag indicating whether or not a parameter related to thedeblocking procedure is present in the slice header may be present inthe slice header. And, based on a case where a value of the at least oneflag is equal to 0, a flag indicating whether or not a parameter relatedto the deblocking procedure is present in the slice header may not bepresent in the slice header. At this point, values ofdeblocking_filter_ph_override_enabled_flag anddeblocking_filter_sh_override_enabled_flag may not be both equal to 1.

Meanwhile, a picture header syntax may be as shown below in thefollowing table.

TABLE 4 picture_header_rbsp( ) { Descriptor  ...  if(rpl_present_in_ph_flag ) {   for( i = 0; i < 2; i++ ) {    if(num_ref_pic_list_in_sps[ i ] > 0 && !pps_ref_pic_list_sps_idc[ i ] &&      (i == 0 | | ( i == 1 && rpl 

 _idx_present_flag ) ) )     pic_rpl_sps_flag[ i ] u( 

 )    if(pic_rpl_sps_flag[ i ] ) {     if( num_ref_pic_lists_in_sps[ i] > 1 &&       ( i = = 0 | | ( i = = 1 && rpl 

 _idx_present_flag ) ) )      pic_rpl_idx[ i ] u(v)    } else    ref_pic_list_struct( i 

  num_ref_pic_lists_in_sps[ i ] )    for( j = 0; j < NumLtrpEntries[ i][ RplsIdx[ i ] ]; j++ ) {     if( ltrp_in_slice_header_flag[ i ][RplsIdx[ i ] ] )      pic_poc_ 

 sb_ 

 t[ i ][ j ] u(v)     pic_delta_poc_msb_present_flag[ i ][ j ] u( 

 )     if( pic_delta_poc_msb_present flag[ i ][ j ] )     pic_delta_poc_msb_cycle 

 t[ i ][ j ] ue(v)    }   }  }  ...  if( sps_sao_enabled_flag &&sao_present_in_ph_flag ) {   pic_sao_luma_enabled_flag u( 

 )   if(ChromaArrayType != 0 )    pic_sao_chroma_enabled_flag u( 

 )  }  if( sps_alf_enabled_flag && alf_present_in_ph_flag ) {  pic_alf_enabled_flag u( 

 )   if( pic_alf_enabled_flag ) {    pic_num_alf_aps_ids_luma u(3)   for( i = 0; i < pic_num_alf_aps_ids_luma; i++ )    pic_alf_aps_id_luma[ i ] u(3)    if( ChromaArrayType != 0 )    pic_alf_chroma_idc u(2)    if( pic_alf_chroma_idc )    pic_alf_aps_id_chroma u(3)   }  }  ...  if(deblocking_filter_ph_override_enabled_flag ) {  pic_deblocking_filter_override_present_flag u( 

 )   if( pic_deblocking_filter_override_present_flag ) {   pic_deblocking_filter override_flag u( 

 )    if( pic_deblocking_filter_override_flag ) ;    pic_deblocking_filter_disabled_flag u( 

 )     if( !pic_deblocking_filter_disabled_flag ) {     pic_beta_offset_div2 se(v)      pic_tc_offset_div2 se(v)     }    }  }  }  ... }

indicates data missing or illegible when filed

Semantics of syntax elements included in the syntax of Table 4 may, forexample, be indicated as shown below in Table 5.

TABLE 5 pic_deblocking_filter_override_present_flag equal to 1 specifiesthat pic_deblocking_filter_override_flag is present in the PH.pic_deblocking_filter_override_present_flag equal to 0 specifies thatpic_deblocking_filter_override_flag is not present in the PH. Whenpic_deblocking_filter_override_present_flag is not present, it isinferred to be equal to 0. pic_deblocking_filter_override_flag equal to1 specifies that deblocking parameters are present in the PH.pic_deblocking_filter_override_flag equal to 0 specifies that deblockingparameters are not present in the PH. When not present, the value ofpic_pic_deblocking_filter override flag is inferred to be equal to 0.pic_deblocking_filter_disabled_flag equal to 1 specifies that theoperation of the deblocking filter is not applied for the slicesassociated with the PH. pic_deblocking_filter_disabled_flag equal to 0specifies that the operation of the deblocking filter is applied for theslices associated with the PH. When pic_deblocking_filter_disabled_flagis not present, it is inferred to be equal topps_deblocking_filter_disabled_flag. pic_beta_offset_div2 and pic_t 

 _offset_div2 specify the deblocking parameter offsets for β and tC(divided by 2) for the slices associated with the PH. The values ofpic_beta_offset_div2 and pic_to_offset_div2 shall both be in the rangeof −6 to 6, inclusive. When not present, the values ofpic_beta_offset_div2 and pic_to_offset_div2 are inferred to be equal topps_beta_offset_div2 and pps_to_offset_div2, respectively.

indicates data missing or illegible when filed

Referring to the tables that are presented above, when a value ofdeblocking_filter_ph_override_enabled_flag, which corresponds to a flagindicating whether or not the deblocking procedure is being applied atthe picture level, is equal to 1,pic_deblocking_filter_override_present_flag may be signaled. When avalue of pic_deblocking_filter_override_present_flag is equal to 1, thepic_deblocking_filter_override_flag, which corresponds to a flagindicating whether or not a parameter related to the deblockingprocedure is present in the picture header, may be present in thepicture header. Alternatively, when a value ofpic_deblocking_filter_override_present_flag is equal to 0,pic_deblocking_filter_override_flag, which corresponds to a flagindicating whether or not a parameter related to the deblockingprocedure is present in the picture header, may not be present in thepicture header.

Additionally, when a value of the pic_deblocking_filter_override_flag,which corresponds to a flag indicating whether or not a parameterrelated to the deblocking procedure is present in the picture header, isequal to 1, the deblocking parameters may be present (or may exist) inthe picture header. And, when a value of thepic_deblocking_filter_override_flag, which corresponds to a flagindicating whether or not a parameter related to the deblockingprocedure is present in the picture header, is equal to 0, thedeblocking parameters may not be present (or may not exist) in thepicture header.

Additionally, when a value of pic_deblocking_filter_disabled_flag isequal to 1, a deblocking filter may not be applied for slices beingrelated to the picture header. And, when a value ofpic_deblocking_filter_disabled_flag is equal to 0, a deblocking filtermay be applied for slices being related to the picture header.

Additionally, pic_beta_offset_div2 and pic_tc_offset_div2 mayrespectively designate deblocking parameter offset for β and tC (valuedivided by 2) for slices related to the picture header. Values ofpic_beta_offset_div2 and pic_tc_offset_div2 may all be within a range of−6 to 6.

Meanwhile, a slice header syntax may be as shown below in the followingtable.

TABLE 6 sliceheader( ) { Descriptor  ...  if( !rpl_present_in_ph_flag&&(( nal_unit_type != IDR_W_RADL && nal_unit_ty pe !=        IDR_N_LP) || sps_idr_rpl_present_flag ) ) {   for i = 0; i < 2; i++ ) {    if(num_ref_pic_lists_in_sps[ i ] > 0 && !pps_ref_pic_list_sps_idc[ i ] &&         (i = = 0 | | (i = = 1 && rpl1_idx_present_flag ) ) )    slice_rpl_sps_flag[ i ] u( 

 )    if slice_rpl_sps_flag[ i ] ) {     if( num_ref_pic_Lists_in_sps[ i] > 1 &&         (i = = 0 | | ( i = = 1 && rpl1_idx_present_flag ) ) )      slice_rpl_idx[ i ] u(v)    } else     ref_pic_list_struct( i,num_ref_pic_lists_in_sps[ i ])    for(j = 0; j < NumLtrpEntries[ i][RplsIdx[ i ] ]; i++) {     if( ltrp_in_slice_header_flag[ i ][RplsIdx[i ] ] )      slice_poc_lsb_ 

 t[ i ][ j ] u(v)     slice_delta_poc_msb_present_flag[ i ][ j ] u( 

 )     if( slice_delta_poc_msb_present_flag[ i ][ j ] )     slice_delta_poc_msb_cycle_ 

 t[ i ][ j ] ue(v)    }   }  }  if( rpl_present_in_ph_flag | |((nal_unit_type != IDR_W_RADL && nal_unit_ty pe =     IDR_N_LP) | |sps_idr_rpl_present_flag ) ) {   if( ( slice_type != I &&num_ref_entries[ 0 ][ RplsIds[ 0 ] ] > 1 ) | |    ( slice_type = = B &&num_ref_entries[ 1 ][ RplsIdx[ 1 ] ] > 1 ) )  

     num_ref_idx_active_override_flag u( 

 )    if( num_ref_idx_active_override_flag )     for( i = 0; i < (slice_type = = B ? 2: 1); i++ )      if( num_ref_entries[ i ][RplsIdx[ i] ] > 1 )       num_ref_idx_active_minus1[ i ] ue(v)   }  }  ...  if(sps_sao_enabled_flag && !sao_present_in_ph_flag ) {  slice_sao_luma_flag u( 

 )   if ChromaArrayType != 0 )    slice_sao_chroma_flag u( 

 )  }  if( sps_alf_enabled_flag && !alf_present_in_ph_flag ) (  slice_alf_enabled_flag u( 

 )   if( slice_alf_enabled_flag ) {    slice_num_alf_aps_ids_luma u(3)   for( i = 0; i < slice_num_alf_aps_ids_luma; i++ )    slice_alf_aps_id_luma[ i ] u(3)    if( ChromaArrayType != 0 )    slice_alf_chroma_idc u(2)    if( slice_alf_chroma_idc )    slice_alf_aps_id_chroma u(3)   }  }  if(deblocking_filter_sh_override_enabled_flag)  slice_deblocking_filter_override_flag u( 

 )  if( slice_deblocking_filter_override_flag ) {  slice_deblocking_filter_disabled_flag u( 

 )   if( !slice_deblocking_filter_disabled_flag ) {  slice_beta_offset_div2 se(v)   slice_tc_offset_div2 se(v)   }  }  ...}

indicates data missing or illegible when filed

Semantics of syntax elements included in the syntax of Table 6 may, forexample, be indicated as shown below in Table 7.

TABLE 7 slice_deblocking_filter_override_present_flag equal to 1specifies that slice_deblocking_filter_override_flag is present in theslice. slice_deblocking_filter_override_present_flag equal to 0specifies that slice_deblocking_filter_override_flag is not present inthe slice. When slice_deblocking_filter_override_present_flag is notpresent, it is inferred to be equal to 0.slice_deblocking_filter_override_flag equal to 1 specifies thatdeblocking parameters are present in the slice.slice_deblocking_filter_override_flag equal to 0 specifies thatdeblocking parameters are not present in the slice. When not present,the value of slice_deblocking_filter_override_flag is inferred to beequal to 0. slice_deblocking_filter_disabled_flag equal to 1 specifiesthat the operation of the deblocking filter is not applied for theslice. slice_deblocking_filter_disabled_flag equal to 0 specifies thatthe operation of the deblocking filter is applied for the slice. Whenslice_deblocking_filter_disabled_flag is not present, it is inferred tobe equal to pps_deblocking_filter_disabled_flag. slice_beta_offset_div2and slice_tc_offset_div2 specify the deblocking parameter offsets for βand tC (divided by 2) for the slice. The values ofslice_beta_offset_div2 and pic_t 

 _offset_div2 shall both be in the range of −6 to 6, inclusive. When notpresent, the values of slice_beta_offset_div2 and pic_to_offset_div2 areinferred to be equal to pps_beta_offset_div2 and pps_to_offset_div2,respectively.

indicates data missing or illegible when filed

Referring to the tables that are presented above, when a value ofdeblocking_filter_sh_override_enabled_flag, which corresponds to a flagindicating whether or not the deblocking procedure is being applied atthe slice level, is equal to 1,slice_deblocking_filter_override_present_flag may be signaled. When avalue of slice_deblocking_filter_override_present_flag is equal to 1,the slice_deblocking_filter_override_flag, which corresponds to a flagindicating whether or not a parameter related to the deblockingprocedure is present in the slice header, may be present in the sliceheader. Alternatively, when a value ofslice_deblocking_filter_override_present_flag is equal to 0,slice_deblocking_filter_override_flag, which corresponds to a flagindicating whether or not a parameter related to the deblockingprocedure is present in the slice header, may not be present in theslice header.

Additionally, when a value of the slice_deblocking_filter_override_flag,which corresponds to a flag indicating whether or not a parameterrelated to the deblocking procedure is present in the slice header, isequal to 1, the deblocking parameters may be present (or may exist) inthe slice header. And, when a value of theslice_deblocking_filter_override_flag, which corresponds to a flagindicating whether or not a parameter related to the deblockingprocedure is present in the slice header, is equal to 0, the deblockingparameters may not be present (or may not exist) in the slice header.

Additionally, when a value of slice_deblocking_filter_disabled_flag isequal to 1, a deblocking filter may not be applied for slices beingrelated to the slice header. And, when a value ofslice_deblocking_filter_disabled_flag is equal to 0, a deblocking filtermay be applied for slices being related to the slice header.

Additionally, slice_beta_offset_div2 and slice tc_offset_div2 mayrespectively designate deblocking parameter offset for β and tC (valuedivided by 2) for slices. Values of slice_beta_offset_div2 and slicetc_offset_div2 may all be within a range of −6 to 6.

FIG. 9 is a flowchart illustrating an operation of an image encodingapparatus according to an embodiment, and FIG. 10 is a block diagramillustrating a configuration of an image encoding apparatus according toan embodiment.

The method disclosed in FIG. 9 may be performed by the encodingapparatus disclosed in FIG. 2 or FIG. 10 . S910 of FIG. 9 may beperformed by the predictor 220, and S920 of FIG. 9 may be performed bythe adder 250 shown in FIG. 2 . Additionally, S930 may be performed bythe filter 260 shown in FIGS. 2 , and S940 and S950 of FIG. 9 may beperformed by the entropy encoder 240 shown in FIG. 2 .

Furthermore, operations according to S910 to S950 are based on part ofthe description presented above in FIG. 1 to FIG. 8 . Therefore,detailed description that overlap with the description of FIG. 1 to FIG.8 will be omitted or briefly presented for simplicity.

Referring to FIG. 9 , an encoding apparatus according to an embodimentmay determine a prediction mode of a current block and may deriveprediction samples based on the prediction mode (S910). For example, theencoding apparatus may determine a merge mode, an affine (merge) mode ora subblock merge mode as an inter prediction mode that is to be appliedto the current block. However, the present disclosure will not belimited only to this. The encoding apparatus may derive predictionsamples based on the determined inter prediction mode.

The encoding apparatus according to the embodiment may generatereconstructed samples based on the prediction samples (S920). Forexample, the adder 250 of the encoding apparatus may generatereconstructed samples by adding reconstructed residual samples toprediction samples outputted from the predictor 220.

The encoding apparatus according to the embodiment may perform a SampleAdaptive Offset (SAO) procedure on the reconstructed samples (S930). Forexample, the filter 260 of the encoding apparatus may generate modifiedreconstructed samples by performing an SAO procedure on thereconstructed samples.

The encoding apparatus according to the embodiment may generateindication information including a first flag indicating whether the SAOprocedure is applied at a picture level or a slice level (S940). Forexample, the indication information may be included in one of a SequenceParameter Set (SPS) and a Picture Parameter Set (PPS). The first flagmay indicate whether the information related to the SAO procedure ispresent in the picture header or in the slice header. Based on a casewhere a value of the first flag is equal to 1, information related tothe SAO procedure may be present in the picture header. And, based on acase where a value of the first flag is equal to 0, information relatedto the SAO procedure may be present in the slice header.

For example, the indication information may further include a secondflag related to whether signaling of a reference picture list is appliedat a picture level or a slice level. Based on a case where a value ofthe second flag is equal to 1, information related to the signaling of areference picture list may be present in the picture header. And, basedon a case where a value of the second flag is equal to 0, informationrelated to the signaling of a reference picture list may be present inthe slice header.

For example, the indication information may further include a third flagrelated to whether an Adaptive Loop Filter (ALF) procedure is applied ata picture level or a slice level. Based on a case where a value of thethird flag is equal to 1, information related to the ALF procedure maybe present in the picture header. And, based on a case where a value ofthe third flag is equal to 0, the information related to the ALFprocedure may be present in the slice header.

For example, the indication information may further include at least onefourth flag indicating whether a deblocking procedure is applied at apicture level or a slice level. Based on a case where a value of any oneof the at least one fourth flag is equal to 1, a flag indicating whetherparameters related to the deblocking procedure are present in thepicture header may be present in the picture header, and, based on acase where a value of any one of the at least one fourth flag is equalto 0, a flag indicating whether parameters related to the deblockingprocedure are present in the picture header may not be present in thepicture header.

The encoding apparatus according to the embodiment may encode theindication information and image information including the informationrelated to the SAO procedure (S950). For example, the filter 260 of theencoding apparatus may generate the information related to the SAOprocedure, the information related to the ALF procedure or theinformation related to the deblocking filtering procedure.Alternatively, for example, the predictor 220 of the encoding apparatusmay generate information related to signaling of a reference picturelist. The entropy encoder 240 of the encoding apparatus may encodeindication information including a first flag, a second flag, a thirdflag or a fourth flag. Additionally, the entropy encoder 240 of theencoding apparatus may encode the information related to the SAOprocedure, the information related to the ALF procedure, the informationrelated to the deblocking procedure or the information related signalingof reference picture list.

Additionally, the image information may include prediction informationfor the current block. The prediction information may includeinformation on an inter prediction mode or an intra prediction mode thatis being performed on the current block. Additionally, the imageinformation may include residual information that is generated fromoriginal samples by the residual processor 230 of the encodingapparatus.

Meanwhile, the bitstream having image information encoded therein may betransmitted to the decoding apparatus through a network or a (digital)storage medium. Herein, the network may include a broadcast networkand/or a communication network, and so on, and the digital storagemedium may include various storage media, such as USB, SD, CD, DVD,Blu-ray, HDD, SSD, and so on.

FIG. 11 is a flowchart illustrating an operation of an image decodingapparatus according to an embodiment, and FIG. 12 is a block diagramillustrating a configuration of an image decoding apparatus according toan embodiment.

The method disclosed in FIG. 11 may be performed by the decodingapparatus disclosed in FIG. 3 or FIG. 12 . More specifically, S1110 andS1120 of FIG. 11 may be performed by the entropy decoder 310 shown inFIGS. 3, and 51130 may be performed by the predictor 330 shown in FIG. 3. And, S1140 may be performed by the adder 340 shown in FIGS. 3 , andS1150 of FIG. 11 may be performed by the filter 350 shown in FIG. 3 .Furthermore, operations according to S1110 to S1150 are based on part ofthe description presented above in FIG. 1 to FIG. 8 . Therefore,detailed description that overlap with the description of FIG. 1 to FIG.8 will be omitted or briefly presented for simplicity.

A decoding apparatus according to an embodiment may obtain indicationinformation including a first flag indicating whether a Sample AdaptiveOffset (SAO) procedure for a current block is applied at a picture levelor a slice level and prediction related information (S1110). Forexample, the prediction related information may include inter predictionmode information, and the inter prediction mode information may includeinformation indicating at least some of various inter prediction modes.For example, various modes, such as merge mode, skip mode, motion vectorprediction (MVP) mode, Affine mode, subblock merge mode or merge withMVD (MMVD) mode, and so on, may be used.

For example, the indication information may be included in one of aSequence Parameter Set (SPS) and a Picture Parameter Set (PPS).Alternatively, for example, the indication information may include asecond flag indicating whether signaling of a reference picture list isapplied at a picture level or a slice level. For example, the indicationinformation may include a third flag indicating whether an Adaptive LoopFilter (ALF) procedure is applied at a picture level or a slice level.Alternatively for example, the indication information may include atleast one fourth flag indicating whether a deblocking procedure isapplied at a picture level or a slice level.

The decoding apparatus according to the embodiment may parse informationrelated to the SAO procedure from a picture header or a slice headerbased on the first flag (S1120). For example, based on a case where avalue of the first flag is equal to 1, the decoding apparatus may parsethe information related to the SAO procedure from the picture header,and, based on a case where a value of the first flag is equal to 0, thedecoding apparatus may parse the information related to the SAOprocedure from the slice header.

Alternatively, the decoding apparatus may parse information related tothe signaling of the reference picture list from the picture header orthe slice header based on the second flag. For example, based on a casewhere a value of the second flag is equal to 1, the information relatedto the signaling of the reference picture list may be parsed from thepicture header, and, based on a case where a value of the second flag isequal to 0, the information related to the signaling of the referencepicture list may be parsed from the slice header.

Alternatively, the decoding apparatus may parse information related tothe ALF procedure from the picture header or the slice header based onthe third flag. For example, based on a case where a value of the thirdflag is equal to 1, the information related to the ALF procedure may beparsed from the picture header, and, based on a case where a value ofthe third flag is equal to 0, the information related to the ALFprocedure may be parsed from the slice header.

Alternatively, the decoding apparatus may parse information related tothe deblocking procedure from the picture header or the slice headerbased on the at least one fourth flag. For example, based on a casewhere a value of any one of the at least one fourth flag is equal to 1,a flag indicating whether parameters related to the deblocking procedureare present in the picture header may be present in the picture header,and, based on a case where a value of any one of the at least one fourthflag is equal to 0, a flag indicating whether parameters related to thedeblocking procedure are present in the picture header may not bepresent in the picture header.

The decoding apparatus according to the embodiment may generateprediction samples for the current block based on the prediction relatedinformation (1130). For example, the decoding apparatus may performinter prediction based on inter prediction mode information that isincluded in the prediction related information. For example, the interprediction mode information may include information indicating at leastsome of various inter prediction modes. For example, various modes, suchas merge mode, skip mode, motion vector prediction (MVP) mode, Affinemode, subblock merge mode or merge with MVD (MMVD) mode, and so on, maybe used.

The decoding apparatus according to the embodiment may generatereconstructed samples for the current block based on the predictionsamples (S1140). For example, the decoding apparatus may derive residualsamples based on residual information and may generate reconstructedsamples based on the prediction samples and the residual samples. Areconstructed block and reconstructed picture may be derived based onthe reconstructed samples.

The decoding apparatus according to the embodiment may perform the SAOprocedure on the reconstructed samples based on the information relatedto the SAO procedure (S1150). For example, the filter 350 of thedecoding apparatus may generate modified reconstructed samples that aremodified by performing the SAO procedure on the reconstructed samples.

In the above-described embodiment, the methods are described based onthe flowchart having a series of steps or blocks. The present disclosureis not limited to the order of the above steps or blocks. Some steps orblocks may occur simultaneously or in a different order from other stepsor blocks as described above. Further, those skilled in the art willunderstand that the steps shown in the above flowchart are notexclusive, that further steps may be included, or that one or more stepsin the flowchart may be deleted without affecting the scope of thepresent disclosure.

The method according to the above-described embodiments of the presentdocument may be implemented in software form, and the encoding apparatusand/or decoding apparatus according to the present document is, forexample, may be included in the apparatus that performs the imageprocessing of a TV, a computer, a smart phone, a set-top box, a displaydevice, and so on.

When the embodiments in the present document are implemented insoftware, the above-described method may be implemented as a module(process, function, and so on) that performs the above-describedfunction. A module may be stored in a memory and executed by aprocessor. The memory may be internal or external to the processor, andmay be coupled to the processor by various well-known means. Theprocessor may include an application-specific integrated circuit (ASIC),other chipsets, logic circuits, and/or data processing devices. Memorymay include read-only memory (ROM), random access memory (RAM), flashmemory, memory cards, storage media, and/or other storage devices. Thatis, the embodiments described in the present document may be implementedand performed on a processor, a microprocessor, a controller, or a chip.For example, the functional parts shown in each figure may beimplemented and performed on a computer, a processor, a microprocessor,a controller, or a chip. In this case, information on instructions or analgorithm for implementation may be stored in a digital storage medium.

In addition, the decoding apparatus and the encoding apparatus to whichthe present disclosure is applied may be included in a multimediabroadcasting transmission/reception apparatus, a mobile communicationterminal, a home cinema video apparatus, a digital cinema videoapparatus, a surveillance camera, a video chatting apparatus, areal-time communication apparatus such as video communication, a mobilestreaming apparatus, a storage medium, a camcorder, a VoD serviceproviding apparatus, an Over the top (OTT) video apparatus, an Internetstreaming service providing apparatus, a three-dimensional (3D) videoapparatus, a teleconference video apparatus, a transportation userequipment (i.e., vehicle user equipment, an airplane user equipment, aship user equipment, and so on) and a medical video apparatus and may beused to process video signals and data signals. For example, the Overthe top (OTT) video apparatus may include a game console, a blue-rayplayer, an internet access TV, a home theater system, a smart phone, atablet PC, a Digital Video Recorder (DVR), and the like.

Furthermore, the processing method to which the present document isapplied may be produced in the form of a program that is to be executedby a computer and may be stored in a computer-readable recording medium.Multimedia data having a data structure according to the presentdisclosure may also be stored in computer-readable recording media. Thecomputer-readable recording media include all types of storage devicesin which data readable by a computer system is stored. Thecomputer-readable recording media may include a BD, a Universal SerialBus (USB), ROM, PROM, EPROM, EEPROM, RAM, CD-ROM, a magnetic tape, afloppy disk, and an optical data storage device, for example.Furthermore, the computer-readable recording media includes mediaimplemented in the form of carrier waves (i.e., transmission through theInternet). In addition, a bitstream generated by the encoding method maybe stored in a computer-readable recording medium or may be transmittedover wired/wireless communication networks.

In addition, the embodiments of the present document may be implementedwith a computer program product according to program codes, and theprogram codes may be performed in a computer by the embodiments of thepresent document. The program codes may be stored on a carrier which isreadable by a computer.

FIG. 13 shows an example of a content streaming system to whichembodiments disclosed in the present document may be applied.

Referring to FIG. 13 , the content streaming system to which theembodiment(s) of the present document is applied may largely include anencoding server, a streaming server, a web server, a media storage, auser device, and a multimedia input device.

The encoding server compresses content input from multimedia inputdevices such as a smartphone, a camera, a camcorder, and so on. Intodigital data to generate a bitstream and transmit the bitstream to thestreaming server. As another example, when the multimedia input devicessuch as smartphones, cameras, camcorders, and so on, directly generate abitstream, the encoding server may be omitted.

The bitstream may be generated by an encoding method or a bitstreamgenerating method to which the embodiment(s) of the present disclosureis applied, and the streaming server may temporarily store the bitstreamin the process of transmitting or receiving the bitstream.

The streaming server transmits the multimedia data to the user devicebased on a user's request through the web server, and the web serverserves as a medium for informing the user of a service. When the userrequests a desired service from the web server, the web server deliversit to a streaming server, and the streaming server transmits multimediadata to the user. In this case, the content streaming system may includea separate control server. In this case, the control server serves tocontrol a command/response between devices in the content streamingsystem.

The streaming server may receive content from a media storage and/or anencoding server. For example, when the content is received from theencoding server, the content may be received in real time. In this case,in order to provide a smooth streaming service, the streaming server maystore the bitstream for a predetermined time.

Examples of the user device may include a mobile phone, a smartphone, alaptop computer, a digital broadcasting terminal, a personal digitalassistant (PDA), a portable multimedia player (PMP), navigation, a slatePC, tablet PCs, ultrabooks, wearable devices (e.g., Smartwatches, smartglasses, head mounted displays), digital TVs, desktops computer, digitalsignage, and the like. Each server in the content streaming system maybe operated as a distributed server, in which case data received fromeach server may be distributed.

Each server in the content streaming system may be operated as adistributed server, and in this case, data received from each server maybe distributed and processed.

The claims described herein may be combined in various ways. Forexample, the technical features of the method claims of the presentdocument may be combined and implemented as an apparatus, and thetechnical features of the apparatus claims of the present document maybe combined and implemented as a method. In addition, the technicalfeatures of the method claim of the present document and the technicalfeatures of the apparatus claim may be combined to be implemented as anapparatus, and the technical features of the method claim of the presentdocument and the technical features of the apparatus claim may becombined and implemented as a method.

1. An image decoding method performed by a decoding apparatus, the method comprising: obtaining Sample Adaptive Offset (SAO) related flag information indicating whether a (SAO) procedure for a current block is applied at a picture level or a slice level and prediction related information; parsing SAO information for the SAO procedure from a picture header or a slice header based on the SAO related flag information; decoding a current block based on the SAO related flag information and the prediction related information; wherein the decoding the current block includes: deriving a prediction mode based on the prediction related information, generating prediction samples for the current block based on the prediction mode prediction related information, generating reconstructed samples for the current block based on the prediction samples, and performing the SAO procedure on the reconstructed samples based on the information related to the SAO procedure, wherein the SAO related flag information is obtained from a Picture Parameter Set (PPS).
 2. (canceled)
 3. The image decoding method of claim 1, wherein, based on a case where a value of the SAO related flag information is being equal to 1, the SAO information is parsed from the picture header, and wherein, based on the value of the SAO related flag information being equal to 0, the SAO information is parsed from the slice header.
 4. (canceled)
 5. (canceled)
 6. (canceled)
 7. (canceled)
 8. The image decoding method of claim 1, further comprising: obtaining deblocking related flag information indicating whether a deblocking procedure is applied at a picture level or a slice level.
 9. The image decoding method of claim 8, further comprising: parsing information related to the deblocking procedure from the picture header or the slice header based on the deblocking related flag information, and wherein the information related to the deblocking procedure is parsed from only one of the picture header or the slice header.
 10. An image encoding method performed by an encoding apparatus, the method comprising: deriving a prediction mode of a current block; deriving prediction samples based on the prediction mode; generating reconstructed samples based on the prediction samples; performing a Sample Adaptive Offset (SAO) procedure on the reconstructed samples; generating SAO information for the SAO procedure; generating SAO related flag information indicating whether the SAO procedure is applied at a picture level or a slice level; and encoding image information including the SAO related flag information and prediction related information, wherein the SAO related flag information indicates in which one of a picture header or a slice header the SAO information is present, and wherein the SAO related flag information is included in a Picture Parameter Set (PPS).
 11. (canceled)
 12. The image encoding method of claim 10, wherein, based on a value of the SAO related flag information being equal to 1, the SAO information related to the SAO procedure is present in the picture header, and wherein, based on the value of the SAO related flag information being equal to 0, the SAO information is present in the slice header.
 13. (canceled)
 14. (canceled)
 15. The image encoding method of claim 10, wherein the image information further includes deblocking related flag information indicating whether a deblocking procedure is applied at a picture level or a slice level, and wherein information related to the deblocking procedure is present in only one of the picture header or the slice header.
 16. (canceled)
 17. The image decoding method of claim 1, wherein the SAO information is parsed from only one of the picture header or the slice header.
 18. The image decoding method of claim 17, wherein based on a case that the SAO information is parsed from the picture header, the SAO information is not parsed from the slice header, and wherein based on a case that the SAO information is parsed from the slice header, the SAO information is not parsed from the picture header.
 19. The image decoding method of claim 9, wherein based on a case that the information related to the deblocking procedure is parsed from the picture header, the information related to the deblocking procedure is not parsed from the slice header, and wherein based on a case that the information related to the deblocking procedure is parsed from the slice header, the information related to the deblocking procedure is not parsed from the picture header.
 20. The image encoding method of claim 10, wherein the SAO information is present in only one of the picture header or the slice header.
 21. The image encoding method of claim 20, wherein based on a case that the SAO information is present in the picture header, the SAO information is not present in the slice header, and wherein based on a case that the SAO information is present in the slice header, the SAO information is not present in the picture header.
 22. The image encoding method of claim 15, wherein based on a case that the information related to the deblocking procedure is present in the picture header, the information related to the deblocking procedure is not present in the slice header, and wherein based on a case that the information related to the deblocking procedure is present in the slice header, the information related to the deblocking procedure is not present in the picture header.
 23. A non-transitory computer-readable digital storage medium storing a bitstream generated by a method, the method comprising: deriving a prediction mode of a current block; deriving prediction samples based on the prediction mode; generating reconstructed samples based on the prediction samples; performing a Sample Adaptive Offset (SAO) procedure on the reconstructed samples; generating SAO information for the SAO procedure; generating SAO related flag information indicating whether the SAO procedure is applied at a picture level or a slice level; and encoding image information including the SAO related flag information and prediction related information to output the bitstream, wherein the SAO related flag information indicates in which one of a picture header or a slice header the SAO information is present, and wherein the SAO related flag information is included in a Picture Parameter Set (PPS). 